<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Hashed Character Tree</title>

<script src="lib/jquery.js" type="text/javascript"></script>
<script src="lib/jquery.treeview.js" type="text/javascript"></script>

<link rel="stylesheet" href="jquery.treeview.css" />
<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="treescreen.css" />

<script type="text/javascript">
	var treecallRequest;
	var docsRequest;
	function createTXhr() {
		if (window.ActiveXObject) {//IE 예전버전
			treecallRequest = new ActiveXObject("Microsoft.XMLHTTP");
		} else {
			treecallRequest = new XMLHttpRequest();
		}
	}
	function treecall() {
		createTXhr();
		treecallRequest.onreadystatechange = Tcallback;
		treecallRequest.open("get", "search.do?mode=tree", true);
		treecallRequest.send("null");
	}
	function Tcallback() { //본문  출력
		if (treecallRequest.readyState == 4) {//응답을 다 받은 경우
			if (treecallRequest.status == 200) {//응답코드가 200인 경우 - 정상
				var res = treecallRequest.responseText;//
				document.getElementById("treeview").innerHTML = res;
				$("#treeview").treeview({
					control : "#treecontrol",
					animated : "fast",
					collapsed : true,
					unique : true,
				});
			} else {
				document.getElementById("treeview").innerHTML = treecallRequest.status;
			}
		}
	}

	function createDXhr() {
		if (window.ActiveXObject) {//IE 예전버전
			docsRequest = new ActiveXObject("Microsoft.XMLHTTP");
		} else {
			docsRequest = new XMLHttpRequest();
		}
	}
	function docscall(word) {
		createDXhr();
		docsRequest.onreadystatechange = dcallback;
		docsRequest.open("get", "search.do?mode=docs&word=" + word, true);
		docsRequest.send("null");
	}
	function dcallback() { //본문  출력
		if (docsRequest.readyState == 4) {//응답을 다 받은 경우
			if (docsRequest.status == 200) {//응답코드가 200인 경우 - 정상
				var res = docsRequest.responseText;//
				document.getElementById("content").innerHTML = res;
			} else {
				document.getElementById("content").innerHTML = docsRequest.status;
			}
		}
	}

	$(document).ready(function() {
		treecall();
		$("#treeview").treeview({
			control : "#treecontrol",
			animated : "fast",
			collapsed : true,
			unique : true,
		});
	});
</script>
</head>
<body>
	<div style="height: 100%;width:600px">
		<div style="height: 48px;border-bottom:solid 1px black">
			<h1>Goggle Hashed character Tree view</h1>
		</div>
		<div
			style="overflow: auto; height:650px;float: left; width: 250px; border-right: solid 1px black;">
			<div id="treecontrol">
				<a title="Collapse the entire tree below" href="#"><img
					src="images/minus.gif" /> Collapse All</a> <a
					title="Expand the entire tree below" href="#"><img
					src="images/plus.gif" /> Expand All</a>
			</div>
			<ul id="treeview">>>Now loading...
			</ul>
		</div>
		<div id="content"
			style="margin-right:-215px;overflow: auto; height: 650px; width: 338px;float: left; padding:0 5px 0 5px;">
		</div>
	</div>
</body>
</html>